

<title>系统日志</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">控制台</a>
    <a><cite>系统日志</cite></a>
  </div>
</div>

<div class="layui-fluid">   
  <div class="layui-card">
    <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="back-log-list-search">
      <div class="layui-form-item">
        <div class="layui-inline">
          <label class="layui-form-label">账号</label>
          <div class="layui-input-block">
            <input type="text" name="user_name" placeholder="请输入账号" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">账号类型</label>
          <div class="layui-input-block">
            <select name="user_type">
              <option value="">全部</option>
              <option value="1">管理员</option>
              <option value="2">用户</option>
            </select>
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">路径</label>
          <div class="layui-input-block">
            <input type="text" name="path" placeholder="请输入路径" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">时间</label>
          <div class="layui-input-block">
            <input type="text" name="date" class="layui-input" id="back-log-list-search-start" >
          </div>
        </div>
        <div class="layui-inline">
          <button class="layui-btn layuiadmin-btn-log" lay-submit lay-filter="back-log-list-search-submit">
            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
          </button>
        </div>
      </div>
    </div>
    <div class="layui-card-body">
      <table id="back-log-list" lay-filter="back-log-list"></table>  
    </div>
  </div>
</div>

<script>
layui.use('log', layui.factory('log')).use(['admin', 'log', 'table','jquery','laydate'], function(){
  var $ = layui.$
  ,admin = layui.admin
  ,view = layui.view
  ,table = layui.table
  ,form = layui.form
  ,setter = layui.setter
  ,laydate = layui.laydate;
  
  laydate.render({
    elem: '#back-log-list-search-start' //指定元素
    ,range: true 
  });

  form.render(null, 'back-log-list-search');

  //监听搜索
  form.on('submit(back-log-list-search-submit)', function(data){
    var field = data.field;
    
    field.start = field.date.split(" - ")[0];
    field.end = field.date.split(" - ")[1];
    //执行重载
    table.reload('back-log-list', {
      where: field
      ,url:setter.api_back_log_list
    });
  });
});
</script>